import HTTP from '@/libs/http'

class Api extends HTTP {
  //   打卡详情
  detail() {
    return this.request({
      method: 'GET',
      url: '/smart/smart-app/kmusersign/detail'
    })
  }

  // 打卡
  punchClock({ signUpOnwork, onAddress, signUpOutwork, outAddress, code }) {
    return this.request({
      method: 'PUT',
      url: '/smart/smart-app/kmusersign/update',
      data: {
        signUpOnwork,
        onAddress,
        signUpOutwork,
        outAddress,
        code
      }
    })
  }

  // 考勤记录
  getList({ startTime, endTime }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-app/kmusersign/list',
      params: {
        startTime,
        endTime
      }
    })
  }
}

class AttendanceClass {
  constructor() {
    this.Api = new Api()
  }
}
const Attendance = new AttendanceClass()

export default Attendance
